package day03;

public class StandardExercise {
    public static void main(String[] args) {
        /*
        //1)
        System.out.println(10%3);//商3余1
        System.out.println(16%6);//商2余4

        int a1 = 6, b1 = 66;
        a1++;b1--;
        System.out.println(a1);//7
        System.out.println(b1);//65

        int a2 = 6,b2 = 8,c2 = 9;
        int c1 = a2++;
        int c3 = --b2;
        int c4 = a2 + b2 + c2;
        System.out.println(c1);//6
        System.out.println(c3);//7
        System.out.println(c4);//23

        //2)
        int d1 = 6,d2 = 7,d3 = 8;
        boolean d4 =d1<d3;
        System.out.println(d4);//true
        System.out.println(d2>d1);//true
        System.out.println(d3<d2);//false
        System.out.println(d1+d2>20);//false
        System.out.println(d1++>d2);//false,d1自增1 d1=7
        System.out.println(d1++>d2);//false
        System.out.println(d1++>=d3);//true

        //3)
        int e = 6,e1 = 16,e2 = 66;
        boolean e3 =e<e1 && e2<e1;//true+false
        System.out.println(e3);//false
        boolean e4 =e>e1 && e2>e;//false+true
        System.out.println(e4);//false
        boolean e5 =e<e1 && e1<e2;//true+true
        System.out.println(e5);//true
        boolean e6 =e>e1 && e2>e1;//false+false
        System.out.println(e6);//false

        int f = 9,f1 = 10,f2 = 12;
        boolean f3 =f>f1 || f<f2;
        System.out.println(f3);//true
        boolean f4 =!(f1>f2);
        System.out.println(f4);//true

        int g = 6,g1 = 10,g2 = 12;
        boolean g3 = g>g1 && g2++>20;//&&的短路
        System.out.println(g3);//false
        System.out.println(g2);//12,发生短路了

        boolean g4 = g<g1 ||g>g2++;
        System.out.println(g4);//true
        System.out.println(g2);//12,发生短路了

        //4)
        int h =6;
        h += 10;
        System.out.println(h);//16
        h -=5;
        System.out.println(h);//11
        h *=2;
        System.out.println(h);//22
        h /=3;
        System.out.println(h);//7
        h %=2;
        System.out.println(h);//1

        short i = 6;
        i += 10;
        System.out.println(i);//16

        int age = 24;
        System.out.println("age=");//age=
        System.out.println(age);//24
        System.out.println("我的年龄是"+age);//我的年龄是24
        System.out.println("我今年"+age+"岁了");//我今年24岁了

        String name ="Ly";
        System.out.println("大家好,我叫"+name+",今年"+age+"岁了");

        //6)
        int num = 6;
        int flag =num>0?1:1;
        System.out.println(flag);//1

        int j1 = 6,j2 = 9;
        int max = j1>j2?j1:j2;
        System.out.println("max="+max);

        //7)
        double price = 600.0;
        if (price>=500){
            price*=0.8;
        }
        System.out.println("您消费一共"+price+"元");

        int score = 99;
        if (score>=0 && score<=100){
            System.out.println("成绩合法");
        }



        //8)
        double price = 400.0;
        if (price>=500){
            price*=0.8;
        }else{
            price*=0.9;
        }
        System.out.println("您一共消费"+price+"元");

        int score = 979;
        if (score>=0 && score<=100){
            System.out.println("成绩合法");
        }else{
            System.out.println("成绩不合法");
        }


        //9)
        double price = 600.0;
        if (price>=2000){
            price*=0.5;
        }else if (price>=1000){
            price*=0.7;
        }else if (price>=500){
            price*=0.8;
        }else{
            price*=0.9;
        }
        System.out.println("您一共消费"+price+"元");


        //拓展
        int a = 6,b = 9;
        if (a>b){
            System.out.println(a);
        }else{
            System.out.println(b);
        }
        int c = a>b?a:b;
        System.out.println(c);


        int year = 1999;
        if (year%4==0 && year%100!=0){
            System.out.println(year+"年是闰年");

        }else{
            System.out.println(year+"年是平年");

         */

        int score = 86;
        if (score<0 || score>100){
            System.out.println("成绩不合法");
        }else if (score>=90){
            System.out.println("你的成绩为A");
        }else if (score>=80){
            System.out.println("你的成绩为B");
        }else if (score>=60){
            System.out.println("你的成绩为C");
        }else{
            System.out.println("你的成绩为D");

        }






    }
}
